package com.example.a_java.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 还款分期明细实体类
 */
@Data
@TableName("repayment_installment")
@Schema(description = "还款分期明细")
public class RepaymentInstallment {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 还款计划ID
     */
    @Schema(description = "还款计划ID")
    private Long planId;

    /**
     * 期数
     */
    @Schema(description = "期数")
    private Integer period;

    /**
     * 应还日期
     */
    @Schema(description = "应还日期")
    private LocalDate dueDate;

    /**
     * 应还本金
     */
    @Schema(description = "应还本金")
    private BigDecimal principal;

    /**
     * 应还利息
     */
    @Schema(description = "应还利息")
    private BigDecimal interest;

    /**
     * 应还总额
     */
    @Schema(description = "应还总额")
    private BigDecimal amount;

    /**
     * 剩余本金
     */
    @Schema(description = "剩余本金")
    private BigDecimal principalBalance;

    /**
     * 实际还款日期
     */
    @Schema(description = "实际还款日期")
    private LocalDate payDate;

    /**
     * 实际还款金额
     */
    @Schema(description = "实际还款金额")
    private BigDecimal payAmount;

    /**
     * 状态：pending-待还款, paid-已还款, overdue-逾期
     */
    @Schema(description = "状态：pending-待还款, paid-已还款, overdue-逾期")
    private String status;

    /**
     * 逾期天数
     */
    @Schema(description = "逾期天数")
    private Integer overdueDays;

    /**
     * 罚息
     */
    @Schema(description = "罚息")
    private BigDecimal penalty;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
} 